/**
 * 
 */
package edu.towson.cosc603.coffeemaker;

import static org.junit.Assert.*;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * @author Jesus lamb
 *
 */
public class InventoryTest extends TestCase {
//	private CoffeeMaker cm;
	private Inventory i;
	private Recipe r1;

	/**
	 * @throws java.lang.Exception
	 */
	@Before
	public void setUp() throws Exception {
	//	cm = new CoffeeMaker();
		i = new Inventory();
		r1 = new Recipe();
		r1.setName("Coffee");
		r1.setPrice(50);
		r1.setAmtCoffee(3);
		r1.setAmtMilk(1);
		r1.setAmtSugar(1);
		r1.setAmtChocolate(0);
	}

	/**
	 * @throws java.lang.Exception
	 */
	@After
	public void tearDown() throws Exception {
	//	cm = null;
		r1 = null;
	}
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getChocolate()}.
	 */
	@Test
	public void testGetChocolate() {
		assertEquals(15,i.getChocolate());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#setChocolate(int)}.
	 */
	@Test
	public void testSetChocolate() {
		i.setChocolate(12);
		assertEquals(12,i.getChocolate());
	}
	@Test
	public void testSetChocolateZero() {
		i.setChocolate(0);
		assertEquals(0,i.getChocolate());
	}
	@Test
	public void testSetChocolateNegative() {
		i.setChocolate(-9);
		assertEquals(0,i.getChocolate());
	}
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getCoffee()}.
	 */
	@Test
	public void testGetCoffee() {
		assertEquals(15,i.getCoffee());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#setCoffee(int)}.
	 */
	@Test
	public void testSetCoffee() {
		i.setCoffee(10);
		assertEquals(10,i.getCoffee());
	}
	@Test
	public void testSetCoffeeZero() {
		i.setCoffee(0);
		assertEquals(0,i.getCoffee());
	}
	@Test
	public void testSetCoffeeNegative() {
		i.setCoffee(-3);
		assertEquals(0,i.getCoffee());
	}
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getMilk()}.
	 */
	@Test
	public void testGetMilk() {
		assertEquals(15,i.getMilk());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#setMilk(int)}.
	 */
	@Test
	public void testSetMilk() {
		i.setMilk(9);
		assertEquals(9,i.getMilk());
	}
	@Test
	public void testSetMilkZero() {
		i.setMilk(0);
		assertEquals(0,i.getMilk());
	}
	@Test
	public void testSetMilkNegative() {
		i.setMilk(-9);
		assertEquals(0,i.getMilk());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#getSugar()}.
	 */
	@Test
	public void testGetSugar() {
		assertEquals(15,i.getSugar());
	}

	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#setSugar(int)}.
	 */
	@Test
	public void testSetSugar() {
		i.setSugar(10);
		assertEquals(10,i.getSugar());
	}
	@Test
	public void testSetSugarZero() {
		i.setSugar(0);
		assertEquals(0,i.getSugar());
	}
	@Test
	public void testSetSugarNegative() {
		i.setSugar(-10);
		assertEquals(0,i.getSugar());
	}
	/**
	 * Test method for {@link edu.towson.cosc603.coffeemaker.Inventory#enoughIngredients(edu.towson.cosc603.coffeemaker.Recipe)}.
	 */
	@Test
	public void testEnoughIngredients() {
		assertTrue(i.enoughIngredients(r1));
	}

}
